'''
@author: harumonia
@site: 
@datetime: 2020/3/18 19:46
@software: PyCharm
'''
from application import db
from application.models.article import Article
from application.models.user import User


def get_meetings_detail(page):
    query_res = Article.query.get(int(page))
    return query_res.to_dict()


def get_meetings_title_all():
    # query_res = db.session.query(Article.id).all()
    query_res = Article.query.with_entities(Article.id, Article.title).all()
    return [{'id': foo.id, 'title': foo.title} for foo in query_res]
